<?php
namespace app\admin\validate;
use think\Validate;

class Category extends Validate  //validate验证
{	
	protected $rule=[
	      ['name', 'require|max:10', '分类名不能为空|分类名不能超过十个字'],
		  ['parent_id', 'number'],
		  ['id', 'number'],
		  ['status', 'number|in:-1,0,1', '状态必须是数字|只能是-1,0,1'],
	
	
	
	
	];
	//场景设置
	protected $scene = [
	    'add' => ['name', 'parenr_id','id'],
		'listorder' => ['id', 'listorder'],
		'status' => ['id', 'status'],
		
	];
	
	
	
	
	
	
	
	
}
?>